home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-30 | 2.6 KB | 62 lines | [TEXT/ttxt] |
- HexCnv 1.0
- __________
-
-
- Hex Converter (HexCnv) converts between decimal and hexadecimal representations
- of integers. If you type in the decimal box (D:) and hit Convert (or just press
- Return or Enter) you get the hex representation, and conversely if you type in
- the hex box (H:).
-
- There are two sets of options:
-
- The check box with the minus sign tells HexCnv whether you want the decimal
- representation of a hex number to be signed, if appropriate. It has no effect
- going from decimal to hex.
-
- The radio buttons tell HexCnv what size of hex number you want (in bits). The
- representation will be padded with leading zeroes or sign-extended with leading
- F's if necessary. If the number is too large for the size, the most significant
- byte(s) will be represented. These settings also affect how numbers are
- translated into decimal if the Signed box is checked. For instance, "FF" with
- Signed turned on will translate into -1 in 8-bit mode, but 255 in 16-bit mode.
- Numbers won't be signed if they're too big for the mode: for instance, hex
- "100" in 8-bit mode gets translated as 256.
-
- In the decimal box, you can enter a comma-separated list of numbers. Each gets
- translated according to the size settings, and the translations are
- concatenated to produce a single hex number. For instance, in 8-bit mode, the
- list "255, 0, 255" will give hex "FF00FF".
-
- A useful trick is to take values from the Color Picker, enter (or paste) them
- into the decimal box, set the size to 8-bit, and you get an appropriate
- six-digit hex number for HTML backgrounds, etc.
-
- PS: This works particularly well with Mike Tilstra's GetColor FKEY, which lets
- you select a colour from anywhere on the screen, presents the Color Picker, and
- places the RGB values on the ClipBoard. Just paste them with Command-V into Hex
- Converter, hit return, use the tab to move into the Hex box, copy with
- Command-C, and you have your hex string ready to paste into a document.
- GetColor FKEY is available at UMich and other sites, and also off my page (see
- below).
-
- Bugs
-
- Hex Converter currently uses the Macintosh Toolbox routines NumToString and
- StringToNum for conversions into and out of decimal. This means:
-
- (a) there is no error checking on decimal numbers;
- (b) you can have leading spaces, but _not_ before the minus sign;
- (c) you can't have unsigned 32-bit numbers.
-
- A future version of Hex Converter will probably replace these calls with custom
- routines, but that's how it is for now. The hex conversion routines are custom
- written and better behaved.
-
- Freeware.
-
- Jason Johnston
- <jcj@extro.ucc.su.oz.au>
- <http://www.usyd.edu.au/~jcj/>
-
- November 1995
-